import Vue from "vue";
import Antd from "ant-design-vue";
import App from "./App.vue";
import "ant-design-vue/dist/antd.css";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";

// 引入动态路由表
import routerData from "./routerList/addRouter";

// 引入echarts,并且实例化
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
// 引入elementui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

// 导出excel表格
import JsonExcel from "vue-json-excel";
Vue.component("downloadExcel", JsonExcel);

import requests from "./request/request"; // axios的引入
Vue.prototype.rq = requests.requests; // axios的全局挂载

Vue.config.productionTip = false;
Vue.use(Antd);
Vue.use(ElementUI);
new Vue({
  router,
  store,
  render: (h) => h(App),
  // 挂载的时候就重新添加路由
  mounted() {
    store.dispatch("changeRoelAsync", routerData);
  },
}).$mount("#app");
